{# Copyright The IETF Trust 2015-2023, All Rights Reserved #}
<!DOCTYPE html>
{% load analytical %}
{% load ietf_filters static %}
{% load origin %}
{% origin %}
{% load django_bootstrap5 %}
{% load django_vite %}
<html data-bs-theme="auto" lang="en" {% block html_attrs %}{% endblock %}>
    <head>
        {% analytical_head_top %}
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>
            {% block title %}No title{% endblock %}
        </title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="traceparent" content="{{ otel.traceparent }}">
        <link href="{{ settings.STATIC_IETF_ORG }}/fonts/inter/import.css" rel="stylesheet">
        <link href="{{ settings.STATIC_IETF_ORG }}/fonts/noto-sans-mono/import.css" rel="stylesheet">
        <link rel="stylesheet" href="{% static 'ietf/css/ietf.css' %}">
        <link rel="stylesheet" href="{% static 'ietf/css/select2.css' %}">
        {# load this in the head, to prevent flickering #}
        <script src="{% static 'ietf/js/theme.js' %}"></script>
        <style>
            {% block morecss %}{% endblock %}
        </style>
        {% vite_hmr_client %}
        {% block pagehead %}{% endblock %}
        {% vite_asset 'client/embedded.js' %}
        {% include "base/icons.html" %}
        <script src="{% static 'ietf/js/ietf.js' %}"></script>
        {% analytical_head_bottom %}
    </head>
    <body {% block bodyAttrs %}{% endblock %} class="navbar-offset position-relative"
          data-group-menu-data-url="{% url 'ietf.group.views.group_menu_data' %}">
        {% analytical_body_top %}
        {% include "base/status.html" %}
        <a class="visually-hidden visually-hidden-focusable" href="#content">Skip to main content</a>
        <nav class="navbar navbar-expand-lg fixed-top {% if server_mode and server_mode != "production" %}bg-danger-subtle{% else %}bg-secondary-subtle{% endif %}">
            <div class="container-fluid">
                <a class="navbar-brand" href="/">
                    {% include "logo.html" with org="ietf" classes="me-2" nor=True only %}
                    Datatracker
                    {% if server_mode and server_mode != "production" %}
                        <span class="text-danger">&delta;</span>
                    {% endif %}
                </a>
                <div class="collapse navbar-collapse" id="navbar-collapse">
                    <ul class="nav navbar-nav flex-nowrap">
                        {% include "base/menu.html" with flavor="top" %}
                    </ul>
                </div>
                <div class="d-flex align-items-center">
                    <a class="nav-link text-danger d-none d-xl-inline me-xl-4"
                       target="_blank"
                       href="https://github.com/ietf-tools/datatracker/issues/new/choose">
                        Report a bug
                        <i class="bi bi-bug"></i>
                    </a>

                    {% if not user.is_authenticated %}
                        <a class="btn me-1 {% if server_mode and server_mode == "production" %} btn-warning {% else %} btn-info {% endif %} d-none d-sm-block"
                           rel="nofollow"
                           href="{% url 'ietf.ietfauth.views.login' %}?next={{ request.get_full_path|removeprefix:'/accounts/logout'|removeprefix:'/accounts/login/?next='|urlencode }}">
                            Sign in
                        </a>
                    {% endif %}

                    <label class="d-none d-md-block" aria-label="Document search">
                    <input class="form-control select2-field search-select"
                           id="navbar-doc-search"
                           data-select2-ajax-url="{% url 'ietf.doc.views_search.ajax_select2_search_docs' model_name='document' doc_type='all' %}"
                           type="text"
                           data-placeholder="Document search">
                   </label>
                </div>
                <button class="navbar-toggler"
                        type="button"
                        data-bs-toggle="collapse"
                        data-bs-target="#navbar-collapse"
                        aria-controls="navbar-collapse"
                        aria-expanded="false"
                        aria-label="Toggle navigation">
                    <i class="navbar-toggler-icon"></i>
                </button>
            </div>
        </nav>
        {% block precontent %}{% endblock %}
        <main class="pt-3 container-fluid" id="main">
            <div class="row">
                {% if request.COOKIES.left_menu == "on" and not hide_menu %}
                    <div class="d-none d-md-block bg-light-subtle py-3 leftmenu small">
                        <ul class="nav nav-pills flex-column">
                            {% include "base/menu.html" with flavor="left" %}
                        </ul>
                    </div>
                {% endif %}
                <div class="col mx-lg-3 ietf-auto-nav" id="content">
                    <noscript data-nosnippet>
                        <div class="alert alert-danger alert-ignore my-3">
                            <b>Javascript disabled?</b> Like other modern websites, the IETF Datatracker relies on Javascript.
                            Please enable Javascript for full functionality.
                        </div>
                    </noscript>
                    {% for message in messages %}
                        <div class="alert {% if message.level_tag %} alert-{% if message.level_tag == 'error' %}danger{% else %}{{ message.level_tag }}{% endif %} {% endif %} alert-dismissable fade show">
                            <button type="button"
                                    class="btn-close float-end"
                                    data-bs-dismiss="alert"
                                    aria-label="Close"></button>
                            <div{% if message.extra_tags %} class="{{ message.extra_tags }}"{% endif %}>{{ message.message }}</div>
                        </div>
                    {% endfor %}
                    {% block content %}{{ content|safe }}{% endblock %}
                    {% block content_end %}{% endblock %}
                </div>
            </div>
        </main>
        {% block footer %}
            <footer class="col-md-12 col-sm-12 border-top mt-5 py-5 bg-light-subtle text-center position-sticky">
                <a href="https://www.ietf.org/" class="p-3">IETF</a>
                <a href="https://www.ietf.org/iesg/" class="p-3">IESG</a>
                <a href="https://www.iab.org/" class="p-3">IAB</a>
                <a href="https://www.irtf.org/" class="p-3">IRTF</a>
                <a href="https://www.ietf.org/llc/" class="p-3 text-nowrap">IETF LLC</a>
                <a href="https://trustee.ietf.org/" class="p-3 text-nowrap">IETF Trust</a>
                <a href="https://www.rfc-editor.org/" class="p-3 text-nowrap">RFC Editor</a>
                <a href="https://www.iana.org/" class="p-3">IANA</a>
                <a href="https://www.ietf.org/privacy-statement/" class="p-3 text-nowrap">Privacy Statement</a>
                <div class="small text-body-secondary py-3">
                    {% if version_num %}
                        <a class="mx-2" href="/release/about">About IETF Datatracker</a>
                        <span class="mx-2">
                            {% if server_mode and server_mode == "production" %}
                                <a href="https://github.com/ietf-tools/datatracker/releases/tag/{{version_num}}">
                            {% endif %}
                            Version {{ version_num }}{% if patch %}{{patch}}{% endif %}
                            {% if branch %}({{ branch }} - {{ git_hash|slice:":7" }}){% endif %}
                            {% if server_mode and server_mode == "production" %}
                                </a>
                            {% endif %}
                        </span>
                    {% endif %}
                    <a class="mx-2" href="https://status.ietf.org" target="_blank">System Status</a>
                    <span class="mx-2 text-danger">
                        <i class="bi bi-bug"></i>
                        Report a bug:
                        <a class="text-reset" target="_blank" href="https://github.com/ietf-tools/datatracker/issues/new/choose">GitHub</a>
                        {% if bugreport_email %}
                            <a class="text-reset" href="mailto:{{ bugreport_email }}">Email</a>
                        {% endif %}
                    </span>
                    {% if server_mode and server_mode != "production" %}
                        <br>
                        {% if python_version %}Python {{ python_version }}{% endif %}
                        {% if django_version %}Django {{ django_version }}{% endif %}
                        <br>
                        {% include "debug.html" %}
                    {% endif %}
                </div>
            </footer>
        {% endblock %}
        {% block js %}
        {% endblock %}
        <script src="{% static 'ietf/js/select2.js' %}"></script>
        <script>
            $('#navbar-doc-search').on('select2:select', function (e) {
                window.location.href = e.params.data.url;
            });
        </script>
      {% analytical_body_bottom %}
    </body>
</html>
